package mysql

import "gorm.io/gorm"

type Mail struct {
	gorm.Model
	Title string  `gorm:"type:varchar(20);comment:商品标题"`
	Size  string  `gorm:"type:varchar(20);comment:商品尺寸"`
	Price float64 `gorm:"type:decimal(10,2);comment:商品价格"`
	Stock int     `gorm:"type:int(10);comment:商品尺寸"`
}

func (m *Mail) Info(mailId int) error {
	return DB.Where("mailId = ?", mailId).Limit(1).Find(&m).Error
}
func (m *Mail) Create() error {
	return DB.Create(&m).Error
}
